package org.kazuhiko.pokemon3d.entity.pokemon;

import java.util.ArrayList;
import java.util.Random;

import org.kazuhiko.pokemon3d.entity.TexturedModelEntity;
import org.kazuhiko.pokemon3d.entity.pokemon.enums.Gender;
import org.kazuhiko.pokemon3d.entity.pokemon.enums.Type;

public abstract class Pokemon extends TexturedModelEntity
{
	private Random rand;
	
	private int pokedexId;
	
	private Gender gender;
	
	private float hp;
	private float attack;
	private float defense;
	private float specialAttack;
	private float specialDefense;
	private float speed;
	
	private long xp;
	
	private ArrayList<Type> types;
	
	public Pokemon( int id, int pokedexId, String name, String modelLocation )
	{
		super( id, name, modelLocation );
		this.types = new ArrayList<Type>();
		this.pokedexId = pokedexId;
		
		rand = new Random();
		
		this.gender = ( rand.nextInt( 2 ) == 1 )? Gender.MALE : Gender.FEMALE;
	}
	
	public Gender getGender()
	{
		return gender;
	}
	
	public int getPokedexId()
	{
		return pokedexId;
	}
	
	public long getXP()
	{
		return xp;
	}
	
	public void setXP( long xp )
	{
		this.xp = xp;
	}
	
	public void addXP( long xp )
	{
		this.xp += xp;
	}
	
	public void addType( Type type )
	{
		if( !types.contains( type ) )
		{
			types.add( type );
		}
	}
	
	public ArrayList<Type> getTypes()
	{
		return types;
	}
	
	public void setGender( Gender gender )
	{
		this.gender = gender;
	}
	
	public float getHP()
	{
		return hp;
	}
	
	public void setHP( float hp )
	{
		this.hp = hp;
	}
	
	public float getAttack()
	{
		return attack;
	}
	
	public void setAttack( float attack )
	{
		this.attack = attack;
	}
	
	public float getDefense()
	{
		return defense;
	}
	
	public void setDefense( float defense )
	{
		this.defense = defense;
	}
	
	public float getSpecialAttack()
	{
		return specialAttack;
	}
	
	public void setSpecialAttack( float spAttack )
	{
		this.specialAttack = spAttack;
	}
	
	public float getSpecialDefense()
	{
		return specialDefense;
	}
	
	public void setSpecialDefense( float spDefense )
	{
		this.specialDefense = spDefense;
	}
	
	public float getSpeed()
	{
		return speed;
	}
	
	public void setSpeed( float speed )
	{
		this.speed = speed;
	}
}
